package com.umeox.watch.moto.apiclient.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by Rambo 2020/5/15
 * Describe:
 */
public class DeviceCodeDTO implements Parcelable {
    /**
     * 二维码
     */
    public String qrCode;
    /**
     * 动态绑定码
     */
    public String bindCode;

    /**
     * 过期时间，unix时间戳，精度到毫秒
     */
    public long expiredTime;

    @Override
    public String toString() {
        return "DeviceCodeDTO{" +
                "qrCode='" + qrCode + '\'' +
                ", bindCode='" + bindCode + '\'' +
                ", expiredTime=" + expiredTime +
                '}';
    }

    public DeviceCodeDTO() {

    }

    protected DeviceCodeDTO(Parcel in) {
        this.qrCode = in.readString();
        this.bindCode = in.readString();
        this.expiredTime = in.readLong();
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.qrCode);
        dest.writeString(this.bindCode);
        dest.writeLong(this.expiredTime);
    }


    public static final Creator<DeviceCodeDTO> CREATOR = new Creator<DeviceCodeDTO>() {
        @Override
        public DeviceCodeDTO createFromParcel(Parcel source) {
            return new DeviceCodeDTO(source);
        }

        @Override
        public DeviceCodeDTO[] newArray(int size) {
            return new DeviceCodeDTO[size];
        }
    };

}
